home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 January / macformat-033.iso / mac / Shareware City / Applications / State-Smart ƒ / Scripts / ßScripts / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1995-10-24  |  18.9 KB  |  20 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>1</cardCount>
  7.     <cardID>3040</cardID>
  8.     <listID>3975</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>--Intellimation suggested routines ---
  17. on unLockIt
  18. set the userlevel to 5
  19. show message
  20. show tool window at 40,20
  21. end unLockIt
  22.  
  23. on LockIt
  24. global UL
  25. set the userlevel to UL
  26. hide message
  27. hide tool window
  28. end LockIt
  29.  
  30. on uf --unlock fields
  31. TogFields unlock
  32. end uf
  33.  
  34. on lf --lock fields
  35. TogFields lock
  36. end lf
  37.  
  38. on TogFields arg
  39. if arg is "lock" then put true into tog else put false into tog
  40. put the number of bg flds into nbgf
  41. put the number of cd flds into ncdf
  42. repeat with i = 1 to nbgf
  43. set the lockText of bg fld i to tog
  44. end repeat
  45. repeat with i = 1 to ncdf
  46. set the lockText of cd fld i to tog
  47. end repeat
  48. end TogFields
  49.  
  50.  
  51.  
  52. on doWindows
  53. put the number of lines of the windows into n
  54. repeat with i = 1 to n
  55. put line i of the windows
  56. wait until the mouseclick
  57. end repeat
  58. end doWindows
  59.  
  60. on resumeStack
  61. global isinit
  62. if not(isinit is true) then initSS
  63. pass resumeStack
  64. end resumeStack
  65.  
  66.  
  67.  
  68. on initSS
  69.  
  70. --check the version
  71. if the version <2.0 then
  72. answer "this stack requires HyperCard version 2.0 or above"¬¨
  73. with "Continue" or "Go Home"
  74. if it is "Go Home" then go Home
  75. end if
  76. global isinit
  77. global ul,USRLVL
  78. if not (isinit is true) then
  79. --save the current userlevel
  80. put the userlevel into ul
  81. --initialize system globals
  82. lock screen
  83. push cd
  84. set the lockmessages to true
  85. go "¬ßControl"
  86. put cd fld "globlist" of cd "help" into gl
  87. put the number of lines of gl into n
  88. get cd fld "memory" of cd "help"
  89. repeat with i = 1 to n
  90. put line i of gl into vr
  91. put "global " & vr into lin
  92. do lin
  93. put "put line " & i & " of it into " & vr into lin
  94. do lin
  95. end repeat
  96.  
  97. --these globals aren't stored because the user can't change them
  98. global NUMREG,¬¨
  99. NUMCAT,¬
  100. NONO,¬
  101. NAMENO,¬
  102. SWNO,¬
  103. SONGNO,¬
  104. ATCNO,¬
  105. IDNO,¬
  106. NUMOPT
  107. put 6 into NUMREG
  108. put 13 into NUMCAT
  109. put 8 into NUMOPT
  110. put the number of cd btn "NO" of cd "US home" into NONO
  111. put the number of cd btn "SW" of cd "US home" into SWNO
  112. put the number of cd btn "NAME" of cd "US home" into NAMENO
  113. put the number of cd btn "SONG" of cd "US home" into SONGNO
  114. put the number of cd btn "ATC" of cd "US home" into ATCNO
  115. put the number of cd btn "Score Data" of cd "US home" into IDNO
  116. pop cd
  117. set the lockmessages to false
  118. end if
  119.  
  120.  
  121.  
  122. --put OUR credits in the Apple menu
  123. put "About State-Smart..." into menuItem 1 of menu 1
  124. set the menuMsg of menuItem 1 of menu 1 to "About"
  125.  
  126.  
  127. --use the saved State-Smart user level
  128. if USRLVL <> ""then  set the userLevel to USRLVL
  129.  
  130. --create the State-Smart menu
  131. if "State-Smart" is not in the menus then
  132. create menu "State-Smart"
  133. put "Print Map" & RETURN¬¨
  134. & "Export Map"& RETURN¬¨
  135. & "New Map" & RETURN¬¨
  136. & "-" & RETURN¬¨
  137. & "Quiz" & RETURN¬¨
  138. & "Sound" & RETURN¬¨
  139. & "Quiz Options" & RETURN¬¨
  140. & "Locate"& RETURN¬¨
  141. & "Locate Next"& RETURN¬¨
  142. & "Graph Data" & RETURN¬¨
  143. & "Palette" & RETURN¬¨
  144. & "New Password" & RETURN¬¨
  145. & "DeCrypt" into menu "State-Smart"
  146. enable menu "State-Smart"
  147.  
  148. --now make the menu do what we want it to
  149. global snd
  150. if snd <> "" then ¬¨
  151. set the checkMark of menuItem "Sound" of menu "State-Smart" to snd
  152. disable menuItem "New Map" of menu "State-Smart"
  153. put the number of menuItems of menu "State-Smart" into nit
  154. set the lockmessages to true
  155. push cd
  156. go "¬ßControl"
  157. put cd fld "mumsgs" of first cd into temp
  158. pop cd
  159. set the lockmessages to false
  160. repeat with i = 1 to nit
  161. set the menuMsg of menuItem i of menu "State-Smart" to line i of temp
  162. end repeat
  163. set the cmdChar of menuItem "Locate" of menu "State-Smart" to L
  164. set the cmdChar of menuItem "Locate Next" of menu "State-Smart" to G
  165. end if
  166. global isinit
  167. put true into isinit  --we are initting now
  168. unlock screen
  169. end initSS
  170.  
  171.  
  172.  
  173. on saveSS
  174. lock screen
  175. push cd
  176. set the lockmessages to true
  177. go "¬ßControl"
  178. set the lockmessages to false
  179. put cd fld "globlist" of cd "help"  into gl
  180. put the number of lines of gl into n
  181. repeat with i = 1 to n
  182. put line i of gl into vr
  183. put "global " & vr into lin
  184. do lin
  185. put "put "& vr & " into line " & i & " of temp" into lin
  186. do lin
  187. end repeat
  188. put temp into card field "memory" of card "help"
  189. pop cd
  190. unlock screen
  191. end saveSS
  192.  
  193.  
  194.  
  195. on doMenu x
  196. if (x is "Open Stack...") or  (x is "Go Home")¬¨
  197. or (x is "Close Stack") or (x is "New Stack...")¬¨
  198. or (x is "Quit HyperCard") then
  199. --because we don't want to do a complete reinit each time
  200. -- if "State-Smart" is in the menus then delete menu "State-Smart"
  201. --  if "Map Color" is in the menus then delete menu "Map Color"
  202. --  put "About HyperCard..." into menuItem 1 of menu 1
  203. --set the menuMsg of menuItem 1 of menu 1 to empty
  204. reset menubar
  205. saveSS --this is why we include Quit HyperCard
  206. global isinit
  207. put false into isinit
  208. end if
  209. pass doMenu
  210. end doMenu
  211.  
  212. on About
  213. visual dissolve slow to cd
  214. go cd "About¬ß" of stack "¬ßControl"
  215. end About
  216.  
  217. function stkn c
  218. if c is "C" then return( "¬ßCities")
  219. else if c is "T" then return("¬ßTopography" )
  220. else if c is "X" then return("¬ßContours")
  221. else if c is "A" then return("¬ßCities")
  222. else return( "¬ßControl")
  223. end stkn
  224.  
  225. on doGraph
  226. go first card of bg "Map Color BG" of stack "¬ßControl"
  227. --nav --gets the general navigation palette up
  228. end doGraph
  229.  
  230. on doPal
  231. --gets the appropriate palette window for current stack
  232. --in case it has been inadvertently closed
  233. put the short name of this stack into tsn
  234. if tsn is "¬ßTopography" then put "TopNav" into tpn
  235. if tsn is "¬ßContours" then put "ContPal" into tpn
  236. if tsn is "¬ßCities" then put "CitPal" into tpn
  237. if tsn is "¬ßControl" then put "SSNav" into tpn
  238. if tsn is "¬ßUser Guide" then put "Navigator" into tpn
  239. get the short name of this bg
  240. if it is "Map Color BG" then put "Navigator" into tpn
  241. if it contains "Region" then
  242. dispPal "Compass"
  243. end if
  244. dispPal tpn
  245. end doPal
  246.  
  247. on dispPal pal
  248. put findxy(pal) into xy
  249. lock screen
  250. if pal is not in the windows then
  251. palette pal
  252. end if
  253. unlock screen
  254. if xy is not empty then
  255. show window pal at xy
  256. else
  257. show window pal
  258. end if
  259. end dispPal
  260.  
  261.  
  262. function findxy pal
  263. --this is a workaround for a 2.0 bug where the
  264. --value of a multi item object only evaluates
  265. --to the first item.  I would have much preferred
  266. --to do this inline and use value but it doesn't work
  267. put "global "&pal&"Global" into line
  268. do line
  269. put "if "&pal&"Global is empty then put "&QUOTE&"0,0"&QUOTE&" into ans" into line
  270. do line   --empty if never used before
  271. put "if "&pal&"Global is not empty then put "&pal&"Global into ans" into line
  272. do line   --otherwise use old value
  273. put "if "&pal&"Global is true then put "&QUOTE&QUOTE&" into ans" into line
  274. do line   --true if already showing no need to redo
  275. return ans
  276. end findxy
  277.  
  278.  
  279.  
  280. on protect
  281. put the number of cds into n
  282. repeat with i = 1 to n
  283. set the cantDelete of cd i to TRUE
  284. end repeat
  285. end protect
  286.  
  287. --handler for OFF-MAP buttons
  288. on mouseDown
  289. put char 2 to 3 of word 3 of the target into s
  290. if s is "OM" then
  291. push cd
  292. go cd "ad"
  293. end if
  294. end mouseDown
  295.  
  296. --handler for adjacent state buttons
  297. --these buttons have no scripts so they fall through to here
  298. on mouseUp
  299. put getEffect () into visef  --bases this on the clickloc
  300. put char 2 to 3 of word 3 of the target into xn
  301. if xn is "OM" then
  302. pop card
  303. exit mouseUp
  304. end if
  305. get the short name of this cd
  306. if char 1 of it is "A" then put "C" into char 1 of it
  307. put char 1 to 2 of it & xn into xn
  308. visual visef
  309. go card xn
  310. end mouseUp
  311.  
  312. function getEffect  --for adjacent state buttons
  313. put the clickV into cV
  314. put the clickH into cH
  315. put abs(cH - 256) into epsH
  316. put abs(cV - 171) into epsV
  317. if 1.5 * epsV ‚â• epsH then
  318. if cV ‚â§ 171 then
  319. put "Down" into direc
  320. else
  321. put "Up" into direc
  322. end if
  323. else
  324. if cH ‚â§ 256 then
  325. put "Right" into direc
  326. else
  327. put "Left" into direc
  328. end if
  329. end if
  330. return "scroll" && direc && "slow"
  331. end getEffect
  332.  
  333.  
  334. on doSound
  335. set the checkMark of menuItem "Sound" of menu "State-Smart" to¬¨
  336. not (the checkMark of menuItem "Sound" of menu "State-Smart")
  337. global snd
  338. put not(snd) into snd
  339. end doSound
  340.  
  341.  
  342. on doKillQ
  343. global QINP
  344. answer "Abandon Quiz?" with "OK" or "Cancel"
  345. if it is "OK" then
  346. put false into QINP
  347. put empty into QinpCard
  348. cleanUp
  349. end if
  350. end doKillQ
  351.  
  352. on cleanUp
  353. global fname
  354. if the short name of this bg is not "Info" then
  355. cleanUSHome
  356. --it must be the USA so make sure all the map stuff is showing
  357. else
  358. lock screen
  359. hide bg field "Quiz field"
  360. hide bg btn "Abort"
  361. repeat with i = 1 to 4
  362. put "Answer"&i into bn
  363. put "Question"&i into fn
  364. hide field fn
  365. hide bg button bn
  366. end repeat
  367. if fname is not empty then show bg field fname
  368. show window "SSNav"
  369. unlock screen
  370. end if
  371. end cleanUp
  372.  
  373.  
  374. on doPrint
  375. doMenu "Print Card"
  376. end doPrint
  377.  
  378. on doExport
  379. --put "¬ß" & the short name of this card into nn
  380. set the userlevel to 4
  381. --export paint to file nn
  382. --answer "Exported paint file "&nn with "OK"
  383. choose the pencil tool
  384. doMenu "Export Paint..."
  385. popUL
  386. choose the browse tool
  387. end doExport
  388.  
  389. on goInfo
  390. put the short name of this card into nme
  391. put the name of this bg into tb
  392. if tb contains "Region" then
  393. beep
  394. exit goInfo
  395. else
  396. put "I-" & char 3 to 4 of nme into nme
  397. visual venetian blinds
  398. go card nme of stack "¬ßControl"
  399. end if
  400. end goInfo
  401.  
  402. on goCont
  403. put the short name of this card into nme
  404. put "X-" & char 3 to 4 of nme into nme
  405. visual venetian blinds
  406. if there is a stack "¬ßContours" then
  407. go card nme of stack "¬ßContours"
  408. else
  409. answer "The Contours Data is available in the Registered Version."
  410. end if
  411. end goCont
  412.  
  413. on goCit
  414. put the short name of this card into nme
  415. put "C-" & char 3 to 4 of nme into nme
  416. visual venetian blinds
  417. if there is a stack "¬ßCities" then
  418. go card nme of stack "¬ßCities"
  419. else
  420. answer "The Cities Data is available in the Registered Version."
  421. end if
  422. end goCit
  423.  
  424. on goReg
  425. --this is different in control stack, so it has its own
  426. get bg fld "Region"
  427. put the short name of this card into sn
  428. put (char 1 to 2 of sn) & it into crd
  429. visual iris close slow
  430. go cd crd
  431. end goReg
  432.  
  433. on goUSA
  434. if the short name of this bg contains "Region" then
  435. put the short name of this cd into tcn
  436. put prefix(tcn) & "US" into zo
  437. visual iris close slow
  438. go cd zo
  439. else
  440. go card "US home"of stack "¬ßControl"
  441. end if
  442. end goUSA
  443.  
  444. on goComp n   --compass handler
  445. put item n of bg fld "Compdirs" into place
  446. if place is not empty then
  447. go cd place
  448. else
  449. beep
  450. end if
  451. end goComp
  452.  
  453. on goTop
  454. put the short name of this card into nme
  455. put "T-" & char 3 to 4 of nme into nme
  456. visual venetian blinds
  457. if there is a stack "¬ßTopography" then
  458. go card nme of stack "¬ßTopography"
  459. else
  460. answer "The Topographical Data is available in the Registered Version."
  461. end if
  462. end goTop
  463.  
  464. on doLocate -- locates an item if possible
  465. global placename
  466. global maplist
  467. ask "Place name?" with placename
  468. if the result is "Cancel" then exit doLocate
  469. put it into placename
  470. lock screen
  471. set the cursor to busy
  472. put binsearch(placename) into answer
  473. if answer is empty then
  474. --do a general find
  475. find chars placename
  476. unlock screen
  477. --answer "Not Found" with "OK"
  478. exit doLocate
  479. end if
  480. unlock screen
  481. put item 1 of answer into crd
  482. put item 2 of answer into stk
  483. put item 3 of answer into x
  484. put item 4 of answer into y
  485. if there is a stack stk then
  486. go cd crd of stack stk
  487. if the result is not empty then
  488. answer "Card "&crd&" is missing." with "What?" or "I know"
  489. exit doLocate
  490. end if
  491. set the cursor to hand
  492. marker x,y
  493. end if
  494. end doLocate
  495.  
  496.  
  497. function binsearch place
  498. --finds place in sorted list by alpha
  499. global maplist,mp,coordlist
  500. lock screen
  501. push cd
  502. go bg "index" of stack "¬ßControl"
  503. find string place in fld "dex"
  504. if the foundline is empty then
  505. beep
  506. pop cd
  507. unlock screen
  508. exit binsearch
  509. else
  510. put word 2 of the foundline into lno
  511. put item 2 of line lno of fld "dex" into maplist
  512. put item 3 of line lno of fld "dex" into coordlist
  513. put 2 into mp
  514. put word 1 of maplist into crd
  515. pop cd
  516. unlock screen
  517. end if
  518. put word 1 of coordlist into x
  519. put word 2 of coordlist into y
  520. put char 1 of crd into c
  521. put stkn(c) into stk
  522. return( crd&","&stk&","&x&","&y)
  523. end binsearch
  524.  
  525.  
  526.  
  527. on doFNext  --finds the next location of placeName
  528. global placeName,maplist,mp,coordlist
  529. set the cursor to busy
  530. if placename is empty then
  531. beep
  532. exit doFNext
  533. end if
  534. if maplist is empty then
  535. beep
  536. exit doFNext
  537. end if
  538. put the number of words of maplist into n
  539. if mp>n then
  540. beep
  541. exit doFNext
  542. end if
  543. put word mp of maplist into crd
  544. put char 1 of crd into c
  545. put stkn(c) into stk
  546. if there is a stack stk then
  547. go cd crd of stack stk
  548. put word 2*mp-1 of coordlist into x
  549. put word 2*mp of coordlist into y
  550. add 1 to mp
  551. set the cursor to hand
  552. marker x,y
  553. end if
  554. end doFNext
  555.  
  556. on marker x,y
  557. set the userlevel to 5
  558. lock screen
  559. doMenu "New Button"
  560. set the name of btn "New Button" to "flash"
  561. set the rect of btn "flash" to 0,0,15,15
  562. set the style of btn "flash" to transparent
  563. set the showname of btn "flash" to false
  564. set the autohilite of btn "flash" to false
  565. set the icon of btn "flash" to 1018
  566. choose browse tool
  567. popUL
  568. show cd btn "flash" at x,y
  569. unlock screen
  570. set the lockmessages to true
  571. repeat until the mouseclick
  572. set the hilite of btn "flash" to¬¨
  573. not the hilite of btn "flash"
  574. wait 10
  575. end repeat
  576. set the lockmessages to false
  577. lock screen
  578. set the userlevel to 5
  579. choose button tool
  580. select btn "flash"
  581. domenu "Cut Button"
  582. choose browse tool
  583. popUL
  584. end marker
  585.  
  586.  
  587.  
  588.  
  589. ---------
  590.  
  591. --handler for adjacent state buttons
  592. --these buttons have no scripts so they fall through to here
  593. on mouseUp
  594. put getEffect () into visef  --bases this on the clickloc
  595. put char 2 to 3 of word 3 of the target into xn
  596. if xn is "OM" then
  597. pop cd
  598. exit mouseUp
  599. end if
  600. get the short name of this cd
  601. put char 1 to 2 of it & xn into xn
  602. visual visef
  603. go cd xname
  604. end mouseUp
  605.  
  606.  
  607. function getEffect  --for adjacent state buttons
  608. put the clickV into cV
  609. put the clickH into cH
  610. put abs(cH - 256) into epsH
  611. put abs(cV - 171) into epsV
  612. if epsV ‚â• epsH then
  613. if cV ‚â§ 171 then
  614. put "Down" into dir
  615. else
  616. put "Up" into dir
  617. end if
  618. else
  619. if cH ‚â§ 256 then
  620. put "Right" into dir
  621. else
  622. put "Left" into dir
  623. end if
  624. end if
  625. return "scroll" && dir && "slow"
  626. end getEffect
  627.  
  628.  
  629. --handler for OFF-MAP buttons
  630. on mouseDown
  631. put char 2 to 3 of word 3 of the target into s
  632. if s is "OM" then
  633. push cd
  634. go cd "ad"
  635. end if
  636. end mouseDown
  637.  
  638. function prefix str
  639. return char 1 to 2 of str
  640. end prefix
  641.  
  642. function suffix str
  643. put the number of chars of str into n
  644. return char 3 to n of str
  645. end suffix
  646.  
  647.  
  648.  
  649. ----This is the script for the "Blank" background
  650. ----Insert these lines and uncomment them if the script ever gets
  651. ----trashed out
  652. --on openCard
  653. --get the short name of this card
  654. --if the first char of it is "B" then
  655. -- hide cd pict
  656. -- visual effect dissolve to black
  657. --go back
  658. --end if
  659. --end openCard
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666. on doEnter
  667. --enters data on maps and in index
  668. --not supported
  669. global thename
  670. answer "Is the data on the current map?" with "Yes" or "No"
  671. if it is "No" then
  672. set the result to -3
  673. answer "Go to the correct map and try again" with "OK"
  674. exit doEnter
  675. end if
  676. ask "What is the name of the datapoint?" with "nothing"
  677. if it is "nothing" then
  678. set the result to -3
  679. exit doEnter
  680. end if
  681. put it into thename
  682. put the userlevel into ul
  683. set the userlevel to 5 --(authoring)
  684. answer "Click near a clear place for the label" with "OK"
  685. wait until the mouseclick
  686. answer "Drag label to destination" with "OK"
  687. choose text tool
  688. set the textfont to Geneva
  689. set the textsize to 9
  690. put the textheight into th
  691. click at the clickloc
  692. type name
  693. choose select tool
  694. put item 1 of the clickloc into lft
  695. put item 2 of the clickloc into tp
  696. subtract th from tp
  697. subtract 4 from lft
  698. drag from  lft,tp to (lft + 6*nchar),¬¨
  699. (tp + th + 3)
  700. doMenu "Transparent"
  701. ---
  702. end doEnter
  703.  
  704. on doClick  --not done
  705. global indx,indy,thename
  706. answer "Is this a city location?" with "Yes" or "No"
  707. --Cities get little black dots, others stuff don't
  708. put it into ansr
  709. answer "Please click on the exact location"
  710. wait until the mouseclick
  711. put item 1 of the clickloc into indx
  712. put item 2 of the clickloc into indy
  713. --insert it in the index, (steal code from home)
  714. end doClick
  715.  
  716. on popUL
  717. global USRLVL
  718. set the userlevel to USRLVL
  719. end popUL
  720.  
  721.  
  722. -------Colleen's custom utilities
  723. on doubleEncrypt bgfn,key   --bgfn is the name of a background field
  724. set the locktext of bg fld bgfn to false
  725. put bg fld bgfn into temp
  726. put the number of chars of key into kl
  727. put encrypt (temp,key,kl) into bg fld bgfn
  728. set the locktext of bg fld bgfn to true
  729. end doubleEncrypt
  730.  
  731.  
  732. function encrypt str,key,kl
  733. put the number of chars of str into nc
  734. put 1 into k
  735. repeat with j = 1 to nc
  736. set the cursor to busy
  737. if k > kl then put 1 into k
  738. put charToNum(char j of str) into n1
  739. put charToNum(char k of key) into n2
  740. if n1 <> n2 then put xor(n1,n2) into n2
  741. put numtoChar(n2) into char j of str
  742. add 1 to k
  743. end repeat
  744. return str
  745. end encrypt
  746.  
  747.  
  748.  
  749. function xor a,b
  750. put 0 into answer
  751. repeat with i = 0 to 7
  752. if a >= 2^(7-i) then  --a is,
  753. if not (b >= 2^(7-i)) then
  754. add 2^(7-i) to answer
  755. else
  756. subtract 2^(7-i) from b
  757. end if
  758. subtract 2^(7-i) from a
  759. else if b >= 2^(7-i) then --b is
  760. if not (a >= 2^(7-i)) then
  761. add 2^(7-i) to answer
  762. else
  763. subtract 2^(7-i) from a
  764. end if
  765. subtract 2^(7-i) from b
  766. end if
  767. end repeat
  768. return answer
  769. end xor
  770.  
  771. function enterKey dummy
  772. put empty into key
  773. ask "How many key numbers?"
  774. if it is empty then exit enterKey
  775. put it into kn
  776. repeat with i = 1 to kn
  777. ask "Carefully enter each key number, then press RETURN"
  778. if it is empty then
  779. return ""
  780. end if
  781. put numtoChar(it) after key
  782. end repeat
  783. return key
  784. end enterKey
  785.  
  786.  
  787. on doDeCrypt
  788. ask "Enter 2-letter postal code for state to decrypt"
  789. put "I-"&it into cdn
  790. go cd cdn of stack "¬ßControl"
  791. if the result is not empty then
  792. answer "No such state--try again"
  793. exit doDeCrypt
  794. end if
  795. put enterKey() into key
  796. if key is empty then exit doDeCrypt
  797. answer "Please enter key again to verify"
  798. put enterKey() into vkey
  799. if it is empty then exit doDeCrypt
  800. if vkey <> key then
  801. answer "Key mismatch--try again"
  802. exit doDeCrypt
  803. end if
  804. put bg fld "‚Ä¢lyrics" into lcrypt
  805. put bg fld "‚Ä¢song data" into scrypt
  806. doubleEncrypt "‚Ä¢lyrics",key
  807. doubleEncrypt "‚Ä¢song data",key
  808. hide cd pict
  809. show bg fld "‚Ä¢lyrics"
  810. beep
  811. answer "Verify:  Is deCryption OK?" with "Yes" or "No"
  812. if it is "No" then
  813. put lcrypt into bg fld "‚Ä¢lyrics"
  814. put scrypt into bg fld "‚Ä¢song data"
  815. else
  816. put empty into bg fld "‚Ä¢encrypt"
  817. end if
  818. end doDeCrypt
  819.  
  820. on doNewPW
  821. global SQPW,TCPW  --the two passwords, respectively
  822. answer "Which Password do you want to change?" with "Quiz Options" or "Score Card"
  823. put it into tmp
  824. ask "Old Password?"
  825. if it is "Cancel" then exit doNewPW
  826. else put it into OPW
  827. ask "New Password?"
  828. if it is "Cancel" then exit doNewPW
  829. put it into NPW
  830. if tmp is "Quiz Options" then
  831. if SQPW = OPW then
  832. put NPW into SQPW
  833. else
  834. beep
  835. answer "Key mismatch--try again"
  836. end if
  837. else
  838. if TCPW = OPW then
  839. put NPW into TCPW
  840. else
  841. beep
  842. answer "Key mismatch--try again"
  843. end if
  844. end if
  845. end doNewPW
  846.  
  847.  
  848. on cleanUSHome
  849. lock screen
  850. hide cd fld "State name"
  851. repeat with i = 2 to 51
  852. set the cursor to busy
  853. set the showname of cd btn i to true
  854. end repeat
  855. unlock screen
  856. end cleanUSHome
  857.  
  858. </script>
  859.     <background id="2710" file="background_2710.xml" name="" />
  860.     <card id="3040" file="card_3040.xml" marked="false" name="" owner="2710" />
  861. </stack>
  862.